Description:
It is suggested to replace literal numbers with symbolic constants. It is acceptable to hard code
-1, 0, and 1.
Incorrect:
function PotentialEnergy(mass,height: double):double;
begin
result := mass * 9.81 * height;
end;
Correct:
const G:Double = 9.81;
...
function PotentialEnergy(mass,height: double):double;
begin
result := mass * G * height;
end;
Refactoring: